package com.zhoug.demo.viewpermission.page;

import android.os.Bundle;
import android.widget.Toast;

import androidx.annotation.LayoutRes;
import androidx.appcompat.app.AppCompatActivity;

public abstract class MyBaseActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(getLayoutResId());
        findViews();
        onCreate1(savedInstanceState);
    }

    protected abstract @LayoutRes int getLayoutResId();

    protected abstract void findViews();

    protected abstract void onCreate1(Bundle savedInstanceState);


    protected void toast(Object msg) {
        Toast.makeText(this, msg != null ? msg.toString() : " msg is null", Toast.LENGTH_SHORT).show();
    }

    protected AppCompatActivity getActivity(){
        return this;
    }


}
